package com.example.service.impl;
import com.example.domain.Course;
import com.example.dao.CourseDao;
import com.example.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CourseServiceImpl implements CourseService {

    @Autowired
    private CourseDao courseDao;

    @Override
    public boolean addCourse(Course course) {
        try {
            int rows = courseDao.insertCourse(course);
            return rows > 0; // 判断是否成功插入
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}

